MUSIC
=====

Placeholder: tracks from Final Fantasy IV, VI, VII, Tactics and Chrono
Trigger (CD soundtrack rips) and EarthBound (SPC renders), cut to loop. Replace before any public release.

Each track is an OGG Vorbis file; its id is its path here without ".ogg".

    title             title screen                     FF4  The Prelude
    game_over         the game-over screen (once)      FF4  Theme of Sorrow

    act1/...          act 1                            Final Fantasy IV
    act2/...          act 2                            Final Fantasy VI
    act3/...          act 3                            Final Fantasy VII
    act4/...          act 4 (the Rift)                 Final Fantasy Tactics

  in each act folder:
    map               the map, and everything outside fights (shops, rest
                      sites, events, recruit camps); after a fight it picks
                      up where it left off
    battle            a normal fight
    elite             an elite fight
    boss              an act boss
    final_boss        the boss that ends the run
    victory           a fight won, and the run-won screen

    fights/...        a fight's own track, named by its formation's JSON
                      ("music": "fights/world_revolution"):
                        battle_on_the_bridge  Necrophobe   (FF Tactics)
                        world_revolution      Neo Exdeath  (Chrono Trigger)

    fights/eb_*         the weird battle (weird_encounter event), named
                        by its group in Data/WeirdBattle/weird_battle.json:
                          eb_weird       Battle Against a Weird Opponent
                          eb_unsettling  Battle Against an Unsettling Opponent
                          eb_machine     Battle Against a Machine
                          eb_you_win     You Win! (its victory, looped)
                        (EarthBound, SPC renders from archive.org item
                        earthbound_snes_flac; loops from SmashCustomMusic
                        8826 / 8827 / 4351 / 8855)

A track an act lacks falls back within the act (final_boss -> boss -> elite
-> battle), then to act 1's: act 4 has no victory, so it plays FF4's.
Music starts and stops abruptly, with no fades. Which track plays where is
MusicDirector, in Assets/Scripts/Audio/MusicPlayer.cs.

Loops
-----
loops.json gives each track's loop in samples (at the file's own rate):

    "act1/battle": { "loopStart": 156781, "loopEnd": 2286717 }

The intro (0 to loopStart) plays once, then loopStart to loopEnd repeats,
jumping back on the exact sample. A track with no entry loops whole; one with
"loop": false plays once and stops.

The loops were cut by Tools/music/cut_loops.py from the CD rips listed in
Tools/music/sources.json. Each rip plays intro + loop + loop + fade; the
known loop of the same song (SmashCustomMusic's loop points, from an emulator
rip) sets the target, the rip's own repeat sets the exact length and tempo,
and the seam is aligned by cross-correlation, with a short crossfade baked in
where the rip's two passes differ slightly (hardware recordings).
Tools/music/verify.py checks every seam against the rip playing straight on.

Volume: the Music bar on the Config / OPTIONS screens (saved in profile.json);
musicVolume in Settings/gameplay_options.json is the default before it moves.
Each tenth of the bar is 4 dB, and a full bar plays at half the file's level.
